package com.topit.show.wxapi.vo;

import java.io.Serializable;

public class AccessToken implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3497424962658308308L;
	// 获取到的凭证
	private String access_token;
	// 凭证有效时间，单位：秒
	private int expires_in;

	// 获取token的时间
	private Long getTime;

	public String getAccess_token() {
		return access_token;
	}

	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}

	public int getExpires_in() {
		return expires_in;
	}

	public void setExpires_in(int expires_in) {
		this.expires_in = expires_in;
	}

	public Long getGetTime() {
		return getTime;
	}

	public void setGetTime(Long getTime) {
		this.getTime = getTime;
	}

	public boolean isExpires() {
		return System.currentTimeMillis() - getTime > (expires_in - 5) * 1000;
	}

	@Override
	public String toString() {
		return "AccessToken [token=" + access_token + ",getTime=" + getTime + ", expiresIn=" + expires_in + ", isExpires=" + isExpires() + "]";
	}
}
